home *** CD-ROM | disk | FTP | other *** search
- README for lpansi.c 12/2/1993
- File: lpansi.c Author: Gary Day
- gday@comp.uark.edu
-
- The problem: UNIX supplies a printing program called lp <filename> which
- allows the user to print a text (or any really) file to a
- printer. Unfortunately, that printer is attached to the UNIX
- server which is not where the user usually is. In my case, it is
- about 230 miles away. I needed a similar program that would
- allow me to print to my home printer.
-
- The solution: The VT100 standard defines a printer on and off escape
- sequence. [FYI: esc[5i is printer on, esc[4i is printer off.]
- Lpansi is a VERY simple program that issues a printer on
- sequence, opens the file sent as an argument, reads it character
- by character, echos it to stdout (now your local printer) and
- ends by sending a form feed and printer off command.
-
- Usage: I had several purposes in mind when I wrote this. The first was to
- find a way to replace lp in a gopher client I had with something that
- would print at home. I also wanted to be able to print text
- files to my home printer directly from the UNIX prompt. A
- natural extension of this is to add it to LYNX, and other printing
- clients as your printer command.
-
- Syntax: lpansi <filename>
- This program only accepts one filename as an argument, and not
- command line options. It could be easily modified to accept more
- but that will be up to you to do. It serves my needs.
-
- Thanks: Thanks go to Michael Seibel on the PINE development team for
- helping me find the correct ANSI codes to turn off the printer.
- I found out later that PINE distributes a similar program called
- ansiprt which is supposed to do the same thing. Here, the source
- code is provided so you may incorporate the concept directly in your
- program.
-
- Disclaimer: [Everyone has one so...] I make no promises whatsoever about
- how this will work for you. If you have VT100 and/or ANSI, it
- should work just fine. If it doesn't, quit using it. :) This
- program is free to use and modify, but try to keep my name with
- it. I don't do that much cool stuff, so I need all the credit
- I can get. Thanks.
-
- *** End of README for lpansi.c ***
-